package com.example.demo.controller;

import com.example.demo.entity.Result;
import com.example.demo.service.impl.InterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("sys/interface")
public class InterfaceController {
    @Autowired
    private InterfaceService interfaceService;
    @GetMapping("getAllInterface")
    public Result getAllFinance(@RequestParam Map<String,Object> params, HttpServletRequest request){
        return interfaceService.getAllInterface(params);
    }

    @PostMapping("insertInterface")
    public Result insertButton(@RequestBody Map<String,Object> params, HttpServletRequest request){
        return interfaceService.insertInterface(params);
    }
    @PostMapping("deleteInterface")
    public Result deleteInterface(@RequestBody Map<String,Object> params, HttpServletRequest request){
        return interfaceService.deleteInterface(params);
    }
    @PostMapping("insertRoleInterface")
    public Result insertRoleInterface(@RequestBody Map<String,Object> params, HttpServletRequest request){
        return interfaceService.insertRoleInterface(params);
    }
    @GetMapping("getRoleInterface")
    public Result getRoleInterface(@RequestParam Map<String,Object> params, HttpServletRequest request){
        return interfaceService.getRoleInterface(params);
    }
}
